package com.springboot.web;


import com.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class studentController {
    @Autowired
    private StudentService studentService;
    @RequestMapping(value = "/put")
    public @ResponseBody Object put(String key, String value){
        studentService.put(key,value);
        return "值已放入redis";
    }

    @RequestMapping(value = "/get")
    public @ResponseBody String get(){
        String count =studentService.get("count");
        return "数据count为："+count;
    }
}
